﻿/*  ScheduleRALA, a program for RA/ALA scheduling 
    Copyright (C) 2011  Michael DeRoy

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.*/

using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace ScheduleRALA
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        private string employee_name;

        List<Employee> employeeList = new List<Employee>();

        private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void label5_Click(object sender, EventArgs e)
        {

        }

        private void label5_Click_1(object sender, EventArgs e)
        {

        }

        private void check_monday(object sender, EventArgs e)
        {
        }

        private void check_tuesday(object sender, EventArgs e)
        {
        }

        private void check_wednesday(object sender, EventArgs e)
        {
        }

        private void check_thursday(object sender, EventArgs e)
        {
        }

        private void check_friday(object sender, EventArgs e)
        {
        }

        private void check_saturday(object sender, EventArgs e)
        {
        }

        private void check_sunday(object sender, EventArgs e)
        {
        }

        private bool flipBool(bool a)
        {
            if (a == true) return false;
            else return true;
        }

        private void employee_text_input(object sender, EventArgs e)
        {
            employee_name = parseText(sender.ToString());
        }

        private string parseText(string name)
        {
            return name.Substring(36);
        }

        private void add_employee_clicked(object sender, EventArgs e)
        {
            if (employee_name != null)
            {
                employeeList.Add(new Employee(monday_box.Checked, tuesday_box.Checked, wednesday_box.Checked,
                    thursday_box.Checked, friday_box.Checked, saturday_box.Checked, sunday_box.Checked, employee_name));

                employee_display.Text = employee_display.Text + '\n' + employee_name;
                //clear all inputs
                name_input.Clear();
                //clears comboboxes
                if (monday_box.Checked == false)
                {
                    monday_box.Checked = true;
                }
                if (tuesday_box.Checked == false)
                {
                    tuesday_box.Checked = true;
                }
                if (wednesday_box.Checked == false)
                {
                    wednesday_box.Checked = true;
                }
                if (thursday_box.Checked == false)
                {
                    thursday_box.Checked = true;
                }
                if (friday_box.Checked == false)
                {
                    friday_box.Checked = true;
                }
                if (saturday_box.Checked == false)
                {
                    saturday_box.Checked = true;
                }
                if (sunday_box.Checked == false)
                {
                    sunday_box.Checked = true;
                }
                employee_name = null;
            }
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void clicked_date(object sender, DateRangeEventArgs e)
        {
            if (workTimeCalendar.BoldedDates.Contains(e.Start))
            {
                workTimeCalendar.RemoveBoldedDate(e.Start);
            }
            else
            {
                workTimeCalendar.AddBoldedDate(e.Start);
            }
            workTimeCalendar.UpdateBoldedDates();
        }

        private void generateCalendar_clicked(object sender, EventArgs e)
        {
            GenerateCalendar calendar = new GenerateCalendar(workTimeCalendar.BoldedDates, employeeList);
            calendar.begin();
        }

        private void open_aboutBox(object sender, EventArgs e)
        {
            about_form form = new about_form();
            form.Show();
        }

        private void briansday_clicked(object sender, EventArgs e)
        {
        }
    }
}
